/* Podman Desktop 风格的虚拟机创建向导样式 */

.podman-wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.podman-wizard-container {
  background: var(--color-bg-primary, #1e1e1e);
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border, #3c3c3c);
  display: flex;
  flex-direction: column;
}

/* 头部样式 */
.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: var(--color-bg-secondary, #252526);
  border-bottom: 1px solid var(--color-border, #3c3c3c);
}

.wizard-title-section {
  flex: 1;
}

.wizard-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary, #ffffff);
  line-height: 1.2;
}

.wizard-subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: var(--color-text-secondary, #cccccc);
  line-height: 1.4;
}

.auto-save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-tertiary, #999999);
  margin-top: 8px;
}

.auto-save-status .spinner.small {
  width: 12px;
  height: 12px;
  border-width: 1px;
}

.wizard-close-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary, #cccccc);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-close-btn:hover {
  background: var(--color-hover, #3c3c3c);
  color: var(--color-text-primary, #ffffff);
}

/* 主体内容 */
.wizard-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 进度条 */
.wizard-progress {
  padding: 24px 32px;
  background: var(--color-bg-secondary, #252526);
  border-bottom: 1px solid var(--color-border, #3c3c3c);
}

.progress-bar {
  height: 4px;
  background: var(--color-border, #3c3c3c);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary, #0ea5e9), var(--color-primary-light, #38bdf8));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.step-indicators {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-indicator:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border, #3c3c3c);
  z-index: 1;
}

.step-indicator.completed:not(:last-child)::after {
  background: var(--color-primary, #0ea5e9);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-border, #3c3c3c);
  color: var(--color-text-secondary, #cccccc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.step-indicator.completed .step-number {
  background: var(--color-primary, #0ea5e9);
  color: white;
}

.step-indicator.active .step-number {
  background: var(--color-primary, #0ea5e9);
  color: white;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.step-title {
  font-size: 12px;
  color: var(--color-text-secondary, #cccccc);
  text-align: center;
  font-weight: 500;
  transition: color 0.3s ease;
}

.step-indicator.completed .step-title,
.step-indicator.active .step-title {
  color: var(--color-text-primary, #ffffff);
}

/* 内容区域 */
.wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.step-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary, #ffffff);
  margin: 0 0 8px 0;
}

.step-description {
  font-size: 14px;
  color: var(--color-text-secondary, #cccccc);
  margin: 0 0 32px 0;
  line-height: 1.5;
}

/* 方法选择卡片 */
.method-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.method-card {
  background: var(--color-bg-secondary, #252526);
  border: 2px solid var(--color-border, #3c3c3c);
  border-radius: 8px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.method-card:hover {
  border-color: var(--color-primary, #0ea5e9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

.method-card.selected {
  border-color: var(--color-primary, #0ea5e9);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
}

.method-card.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary, #0ea5e9), var(--color-primary-light, #38bdf8));
}

.method-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
}

.method-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary, #ffffff);
  margin: 0 0 8px 0;
}

.method-card p {
  font-size: 14px;
  color: var(--color-text-secondary, #cccccc);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.method-features {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.method-features span {
  font-size: 12px;
  color: var(--color-text-tertiary, #999999);
  display: flex;
  align-items: center;
  gap: 6px;
}

.method-features span::before {
  content: '•';
  color: var(--color-primary, #0ea5e9);
  font-weight: bold;
}

/* 表单网格 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #ffffff);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label.required::after {
  content: '*';
  color: var(--color-danger, #ef4444);
  margin-left: 2px;
}

/* 输入框样式 */
.form-input,
.form-select,
.form-textarea {
  background: var(--color-input-bg, #1e1e1e);
  border: 1px solid var(--color-border, #3c3c3c);
  border-radius: 6px;
  color: var(--color-text-primary, #ffffff);
  font-size: 14px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-tertiary, #999999);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-textarea.xml-editor {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  background: var(--color-code-bg, #0d1117);
  border-color: var(--color-border-dark, #2d3748);
}

/* 输入组 */
.input-wrapper {
  position: relative;
}

.input-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--color-text-secondary, #cccccc);
}

.input-hint {
  font-size: 12px;
  margin-top: 6px;
  display: block;
}

.input-hint.success {
  color: var(--color-success, #10b981);
}

.input-hint.error {
  color: var(--color-danger, #ef4444);
}

.input-error {
  font-size: 12px;
  color: var(--color-danger, #ef4444);
  margin-top: 6px;
  display: block;
}

/* 文件输入 */
.file-input-wrapper {
  display: flex;
  gap: 8px;
}

.file-input-wrapper .form-input {
  flex: 1;
}

.file-browse-btn {
  background: var(--color-bg-secondary, #252526);
  border: 1px solid var(--color-border, #3c3c3c);
  color: var(--color-text-primary, #ffffff);
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.file-browse-btn:hover {
  background: var(--color-hover, #3c3c3c);
  border-color: var(--color-primary, #0ea5e9);
}

/* 带范围的输入 */
.input-with-range {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memory-input {
  display: flex;
  gap: 8px;
}

.memory-input .form-input {
  flex: 1;
}

.unit-select {
  background: var(--color-bg-secondary, #252526);
  border: 1px solid var(--color-border, #3c3c3c);
  color: var(--color-text-primary, #ffffff);
  padding: 12px;
  border-radius: 6px;
  min-width: 80px;
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--color-border, #3c3c3c);
  border-radius: 3px;
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-primary, #0ea5e9);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

/* 资源摘要 */
.resource-summary {
  background: var(--color-bg-secondary, #252526);
  border: 1px solid var(--color-border, #3c3c3c);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
}

.resource-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resource-label {
  font-size: 12px;
  color: var(--color-text-secondary, #cccccc);
  font-weight: 500;
}

.resource-value {
  font-size: 16px;
  color: var(--color-text-primary, #ffffff);
  font-weight: 600;
}

/* 复选框 */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary, #ffffff);
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border, #3c3c3c);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.form-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--color-primary, #0ea5e9);
  border-color: var(--color-primary, #0ea5e9);
}

.form-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* 单选按钮 */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary, #ffffff);
  user-select: none;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border, #3c3c3c);
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
  border-color: var(--color-primary, #0ea5e9);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--color-primary, #0ea5e9);
  border-radius: 50%;
}

/* MAC地址输入 */
.mac-input-wrapper {
  display: flex;
  gap: 8px;
}

.mac-input-wrapper .form-input {
  flex: 1;
}

.generate-btn {
  background: var(--color-primary, #0ea5e9);
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.generate-btn:hover {
  background: var(--color-primary-hover, #0284c7);
  transform: translateY(-1px);
}

/* 启动顺序 */
.boot-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.boot-order-item {
  padding: 12px;
  background: var(--color-bg-secondary, #252526);
  border: 1px solid var(--color-border, #3c3c3c);
  border-radius: 6px;
}

/* 底部操作 */
.wizard-footer {
  padding: 24px 32px;
  background: var(--color-bg-secondary, #252526);
  border-top: 1px solid var(--color-border, #3c3c3c);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-nav {
  display: flex;
  gap: 12px;
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary, #0ea5e9), var(--color-primary-light, #38bdf8));
  color: white;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-primary-hover, #0284c7), var(--color-primary, #0ea5e9));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background: var(--color-bg-secondary, #252526);
  color: var(--color-text-primary, #ffffff);
  border: 1px solid var(--color-border, #3c3c3c);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-hover, #3c3c3c);
  border-color: var(--color-primary, #0ea5e9);
}

/* 错误信息 */
.wizard-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger, #ef4444);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 32px;
  font-size: 14px;
}

/* 加载动画 */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .podman-wizard-container {
    width: 95%;
    margin: 20px;
  }

  .wizard-header,
  .wizard-progress,
  .wizard-content,
  .wizard-footer {
    padding: 20px;
  }

  .method-cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    flex-direction: column;
    gap: 16px;
  }

  .wizard-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .step-indicators {
    flex-wrap: wrap;
    gap: 16px;
  }

  .step-indicator {
    flex: none;
  }

  .step-indicator:not(:last-child)::after {
    display: none;
  }
}

/* 自定义滚动条 */
.wizard-content::-webkit-scrollbar {
  width: 6px;
}

.wizard-content::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #252526);
}

.wizard-content::-webkit-scrollbar-thumb {
  background: var(--color-border, #3c3c3c);
  border-radius: 3px;
}

.wizard-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light, #4c4c4c);
}

/* CSS 变量定义 */
:root {
  /* 主色调 */
  --color-primary: #0ea5e9;
  --color-primary-light: #38bdf8;
  --color-primary-hover: #0284c7;

  /* 背景色 */
  --color-bg-primary: #1e1e1e;
  --color-bg-secondary: #252526;
  --color-bg-tertiary: #2d2d30;

  /* 边框色 */
  --color-border: #3c3c3c;
  --color-border-light: #4c4c4c;
  --color-border-dark: #2d3748;

  /* 文字色 */
  --color-text-primary: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-tertiary: #999999;

  /* 状态色 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* 交互色 */
  --color-hover: #3c3c3c;
  --color-active: #4c4c4c;

  /* 代码背景 */
  --color-code-bg: #0d1117;
  --color-input-bg: #1e1e1e;
}